<?php
include "include/config.inc.php";

if(!isset($_SESSION['s_activId']))
{
  header('location:index.php');
}
$selectChallan = "SELECT party.gPartyName,party.gAddress,loan.loanId,DATE_FORMAT(loan.loanDate ,'%d-%m-%Y') AS loanDate,
                         loan.weight,item.itemNameGuj,loan.loanAmount,loan.loanVarNo
                    FROM loan
               LEFT JOIN party ON party.partyId = loan.partyId
               LEFT JOIN item ON item.itemId = loan.itemId
                   WHERE loan.loanId = ".$_GET['loanId'];
$selectChallanRes = mysql_query($selectChallan);
while($selectRow  = mysql_fetch_array($selectChallanRes))
{                                             
  $loanId    = $selectRow['loanId'];
  $partyName = $selectRow['gPartyName'];
  $address   = $selectRow['gAddress'];
  $loanDate   = $selectRow['loanDate'];
  $weight   = $selectRow['weight'];
  $itemName   = $selectRow['itemNameGuj'];
  $loanAmount   = $selectRow['loanAmount'];
  $loanVarNo   = $selectRow['loanVarNo'];
}
include("bottom.php");
$smarty->assign('partyName',$partyName);  
$smarty->display('simplePrint.tpl');  
?>